import org.w3c.dom.ls.LSOutput;

import java.util.Arrays;

public class bubbleSort {
    public static void main(String[] args){
        int[] arr={11,5,7,2,6,9};
        bubbleSort(arr);
        }

    public static void bubbleSort(int[] arr){
        for(int j=0;j<arr.length-1;j++){
            for(int i=0;i<arr.length-j-1;i++){
                if(arr[i]>arr[i+1]){
                    int temp=arr[i];
                    arr[i]=arr[i+1];
                    arr[i+1]=temp;
                }
            }
        }
        System.out.println(Arrays.toString(arr));
    }
}
